<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://www.ecside.org" prefix="ec"%>
<jsp:useBean id="pageBean" scope="request" class="com.agileai.hotweb.domain.PageBean"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>团队人员</title>
<%@include file="/jsp/inc/resource.inc.jsp"%>
<script language="javascript">
var addTeam;
function addTeamStaff(){
	if (!addTeam){
		addTeam = new PopupBox('addTeam','请选择目标目录',{size:'normal',height:'410px',width:'510px',top:'3px'});
	}
	var handlerId = "AddTeamStaff";
	var piId = $("#PI_ID").val();
	var url = 'index?'+handlerId+'&PI_ID='+piId;
	addTeam.sendRequest(url);
}
function refresh(){
	doSubmit({actionType:'refresh'});
}
function checkDel(){
	if (!isSelectedRow()){
		jAlert('请先选中一条记录!');
		return;
	}
	jConfirm('确认要删除该条记录吗？',function(r){
		if(r){
			postRequest('form1',{actionType:'checkDelete',showSplash:false,onComplete:function(responseText){
				if ("last" == responseText){
					jConfirm('该人员没有项目关联，删除后将不能登陆系统，是否删除？',function(r){
						if(r){
							$("#isLast").val("true");
							doSubmit({actionType:'delete'});
						}else{
							jConfirm('将执行移除方法，是否要移除？',function(r){
								if(r){
									doSubmit({actionType:'delete'});
								}
							})
						}
					})
				}else{
					doSubmit({actionType:'delete'});
				}
			}});
		}
	});
}

</script>
</head>
<body>
<form action="<%=pageBean.getHandlerURL()%>" name="form1" id="form1" method="post">
<%@include file="/jsp/inc/message.inc.jsp"%>
<div id="__ToolBar__">
<table class="toolTable" border="0" cellpadding="0" cellspacing="1">
<tr>
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx" hotKey="A" align="center" onclick="doRequest('insertRequest')"><input value="&nbsp;" title="新增" type="button" class="createImgBtn" />新增</td>
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx" hotKey="S" align="center" onclick="addTeamStaff()"><input value="&nbsp;" title="添加团队人员" type="button" class="setImgBtn" />添加团队人员</td>
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx" hotKey="E" align="center" onclick="doRequest('updateRequest')"><input value="&nbsp;" title="编辑" type="button" class="editImgBtn" />编辑</td>
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx" hotKey="C" align="center" onclick="doRequest('copyRequest')"><input value="&nbsp;" title="复制" type="button" class="copyImgBtn" />复制</td>
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx" hotKey="V" align="center" onclick="doRequest('viewDetail')"><input value="&nbsp;" title="查看" type="button" class="detailImgBtn" />查看</td>   
   <td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx" hotKey="D" align="center" onclick="checkDel()"><input value="&nbsp;" id="delImgBtn" title="删除" type="button" class="delImgBtn" />删除</td>
</tr>
</table>
</div>
<div id="__ParamBar__">
<table class="queryTable"><tr><td>
&nbsp;姓名<input id="userName" label="姓名" name="userName" type="text" value="<%=pageBean.inputValue("userName")%>" size="24" class="text" />

&nbsp;编码<input id="userCode" label="编码" name="userCode" type="text" value="<%=pageBean.inputValue("userCode")%>" size="24" class="text" />

&nbsp;<input type="button" name="button" id="button" value="查询" class="formbutton" onclick="doQuery()" />
</td></tr></table>
</div>
<ec:table 
form="form1"
var="row"
items="pageBean.rsList" csvFileName="团队人员.csv"
retrieveRowsCallback="process" xlsFileName="团队人员.xls"
useAjax="true" sortable="true"
doPreload="false" toolbarContent="navigation|pagejump |pagesize |export|extend|status"
width="100%" rowsDisplayed="15"
listWidth="100%" 
height="390px"
>
<ec:row styleClass="odd" ondblclick="doRequest('viewDetail')" oncontextmenu="selectRow(this,{USER_ID:'${row.USER_ID}'});refreshConextmenu()" onclick="selectRow(this,{USER_ID:'${row.USER_ID}'});changeButtonState('${row.PP_POST}');">
	<ec:column width="50" style="text-align:center" property="_0" title="序号" value="${GLOBALROWCOUNT}" />
	<ec:column width="100" property="USER_NAME" title="姓名"   />
	<ec:column width="100" property="USER_CODE" title="编码"   />
	<ec:column width="100" property="USER_SEX" title="性别"   mappingItem="USER_SEX"/>
	<ec:column width="100" property="USER_MAIL" title="邮箱"   />
	<ec:column width="100" property="USER_PHONE" title="电话"   />
	<ec:column width="100" property="PP_POST_NAME" title="岗位"   />
	<ec:column width="100" property="USER_TYPE" title="类型"  mappingItem="USER_TYPE"/>
</ec:row>
</ec:table>
<input type="hidden" name="isLast" id="isLast" value="false"/> 
<input type="hidden" name="USER_ID" id="USER_ID" value="" />
<input type="hidden" name="PI_ID" id="PI_ID" value="<%=pageBean.inputValue("PI_ID")%>" />
<input type="hidden" name="actionType" id="actionType" />
<script language="JavaScript">
setRsIdTag('USER_ID');
var ectableMenu = new EctableMenu('contextMenu','ec_table');


function changeButtonState(userPost){
	if(userPost=='PROJECTMASTER'){
		disableButton("delImgBtn");
	} 
	if(userPost !='PROJECTMASTER'){
		enableButton("delImgBtn");		
	}
}
</script>
</form>
</body>
</html>
<%@include file="/jsp/inc/scripts.inc.jsp"%>
